package com.bupt.entity;

import lombok.Data;

import java.io.Serializable;
import java.util.*;

@Data
public class Route implements Serializable {
    private static final long serialVersionUID = 749864114518164039L;
    private String fromNode;                   //路由首节点
    private String toNode;                     //路由末节点
    private String rate;                       //路由速率
    private String id;                         //路由ID
    private String layer;                      //路由所属层
    private int hop;                        //跳数
    private double length;                     //长度
    private int value;                      //代价
    private boolean success = false;            //是否成功，true为成功，否则为false
    private float reliability;                //可靠性
    private List<String> linkList = new ArrayList<>();          //记录业务路由(不只是fiberLink，layer层的)
    private List<String> linkNameList = new ArrayList<>();
    private List<String> linkTypeList = new ArrayList<>();
    private Set<String> nodeList = new HashSet<>();         //记录业务路由
    private List<String> nodeNameList = new ArrayList<>();
    private List<RouteLinkMsg> routeLinkMsgs = new ArrayList<>();

    public Route(String id) {
        this.id = id;
    }

    public Route() {
        this.id = UUID.randomUUID().toString().replace("-", "");
    }

    public String getFromNode() {
        return fromNode;
    }

    @Data
    public static final class RouteLinkMsg implements Serializable {
        private String linkId;                   //路由中，业务所在层上使用的链路信息
        private String linkName;
        private String linkType;
        private Integer waveLengthNum = null;//波道序号
    }
}
